// Copyright (c) Appeon. All rights reserved.
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. 
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

using System;

namespace SnapObjects.Data
{
    internal interface IStatefulModel
    {
        ModelState ModelState { get; }

        ModelState LatestModelState { get; }

        object Current { get; }

        bool CheckedOut { get; set; }

        object Original { get; }

        ChangeTrackingStrategy ChangeTrackingStrategy { get; }

        void SetCurrentValue(int index, object value);

        void SetCurrentValue(string property, object value);

        object GetOriginalValue(int index);

        object GetCurrentValue(int index);

        object GetOriginalValue(string property);

        object GetCurrentValue(string property);

        object GetOriginalValue(Func<object, object> selector);

        PropertyState GetPropertyState(int index);

        void SetPropertyState(int index, PropertyState propertyState);

        bool IsValueModified(IPropertyMeta property);

        void SetIdentityValue(string name, object value);

        void PerformSetValueOperations(IEmbeddedStateTracker embeddedStateTracker);

        bool HasModifiedProperty();

        bool HasModifiedKey();
    }
}
